<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
      /*  .list li:first-child{
            background-color: #ff8500;
        }*/
        /*nth-child{n}*/
        /*.list li:nth-child(3)
        {
            background-color: #ff6700;
        }
        /*odd 奇数*/
       /* .list li:nth-child(odd){
            background-color: #b0b0b0;
        }
        /*偶数*/
       /* .list li:nth-child(even){
            background-color: white;
        }
      /*奇偶行*/
      /*偶数行*/
      /*.list li:nth-child(2n){
          background-color: darkcyan;
      }
      .list li:nth-child(2n+1){
          background-color: darkred;
      }

      /*n+3是一个公式，n会从0开始计数*/
     /* .list li:nth-child(n+3){
          background-color: darkblue;
      }*/

      /*前三个*/
      /*.list li:nth-child(-n+3){
          background-color: darkgoldenrod;
      }*/
      /*四的倍数*/
      .list li:nth-child(4n){
          background-color: darkgreen;
      }
    </style>
</head>
<body>
<ul class="list">
    <li>1</li>
    <li>2</li>
    <li>3</li>
    <li>4</li>
    <li>5</li>
    <li>6</li>

    <li>7</li>
    <li>8</li>
    <li>9</li>
</ul>
</body>
</html>